package soft.edu.service.Impl;

import soft.edu.common.ServerResponse;
import soft.edu.dao.SchExamAreaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import soft.edu.pojo.SchExamArea;
import soft.edu.service.SchExamAreaService;

import java.util.List;

@Controller("schExamAreaService")
public class SchExamAreaServiceImpl implements SchExamAreaService {

    @Autowired
    private SchExamAreaMapper schExamAreaMapper;

    public ServerResponse<List<SchExamArea>> getInfo(String year,String exa_uni_name, String exa_college_name, String exa_maj_name){
        List<SchExamArea> listSchExamArea = schExamAreaMapper.getInfo(year,exa_uni_name,exa_college_name,exa_maj_name);
        if(listSchExamArea.isEmpty()){
            return ServerResponse.createByErrorMessage("考试范围信息查询不到");
        }else {
            return ServerResponse.createBySuccess("考试范围信息查询成功",listSchExamArea);
        }
    }
}
